/**
 * JAVACC DEMO 1.0
 */
package com.apache.passport.service.plugins;

import com.apache.api.manager.PluginConnector;
import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.database.constant.Validator;
import com.apache.database.db.IDao;
import com.apache.passport.manager.UctUserManager;

/**
 * description:  信息唯一性校验
 */
public class UserOwChkPlugin implements PluginConnector {

	private UctUserManager uctUserManager;

	public void setUctUserManager(UctUserManager uctUserManager) {
		this.uctUserManager = uctUserManager;
	}

	/**
	 * TODO 简单描述该方法的实现功能（可选）.  
	 * @see com.apache.api.manager.PluginConnector#execute(com.apache.api.vo.ParamsVo)  
	 */
	@Override
	public Object execute(ParamsVo paramsvo) throws Exception {
		String userEname = (String) paramsvo.getParams("userEname");
		String email = (String) paramsvo.getParams("email");
		String mobile = (String) paramsvo.getParams("mobile");
		ResultEntity result = new ResultEntity();
		result.setResult("true");
		if (Validator.isNotNull(userEname)) {
			paramsvo.setMethodKey("chkEname");
			result = (ResultEntity) uctUserManager.execute(paramsvo);
			return result;
		}
		if (Validator.isNotNull(email)) {
			paramsvo.setMethodKey("chkEmail");
			result = (ResultEntity) uctUserManager.execute(paramsvo);
			return result;
		}

		if (Validator.isNotNull(mobile)) {
			paramsvo.setMethodKey("chkMobile");
			result = (ResultEntity) uctUserManager.execute(paramsvo);
			return result;
		}
		result.setEntity("T");
		result.setMessage("查询条件为空");
		return result;
	}

}
